<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">

<head>
    <title>动态数据</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
</head>

<body>
    <div class="map-id" id="mapId"></div>
    <link rel="stylesheet" href="/CloundMap/css/dialog.css">
    <script type="text/javascript" src="/CloundMap/map/Init.js"></script>
    

    <script type="text/javascript" src="/CloundMap/js/jquery.js"></script>
    
    <script src="/CloundMap/js/dialog.js"></script>
    
    <script type="text/javascript" src="trafficLine.js"></script>
    <script type="text/javascript">
            var mapConfigResult =  {
                 "mapOpts": {
                     "minZoom":6,
                     "defaultZoom": 12,
                     "maxZoom": 18,
                     "projection": "EPSG:900913",
                     "displayProjection": "EPSG:4326",
                     "restrictedExtent": [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892]
                 },
                 "vectorLayer": [{
                     "layerName": "shanghaiBaseMap1",
                     "layerType": "NPMapLib.Layers.BaiduTileLayer",
                     "layerOpt": {
                         "url": ["http://api0.map.bdimg.com/customimage/tile?&x=${x}&y=${y}&z=${z}&udt=20150601&styles=t%3Aland%7Ce%3Ag%7Cc%3A%23303845%2Ct%3Awater%7Ce%3Aall%7Cc%3A%23232931%2Ct%3Agreen%7Ce%3Aall%7Cc%3A%23232931%2Ct%3Aadministrative%7Ce%3Al.t.s%7Cc%3A%231e232a%2Ct%3Ahighway%7Ce%3Aall%7Cv%3Aoff%7Cc%3A%231e232a%7Cw%3A0.1%2Ct%3Alocal%7Ce%3Aall%7Cv%3Aoff%7Cc%3A%231e232a%7Cw%3A0.1%2Ct%3Asubway%7Ce%3Aall%7Cv%3Aoff%7Cw%3A0.1%2Ct%3Arailway%7Ce%3Aall%7Cv%3Aoff%7Cc%3A%231e232a%7Cw%3A0.1%2Ct%3Aroad%7Ce%3Aall%7Cv%3Aon%7Cc%3A%23ffffff%7Cw%3A0.1%2Ct%3Apoi%7Ce%3Aall%7Cv%3Aoff%2Ct%3Amanmade%7Ce%3Aall%7Cv%3Aoff%2Ct%3Aadministrative%7Ce%3Al.t.f%7Cc%3A%2366788f%7Cw%3A0.1%2Ct%3Alabel%7Ce%3Al.t.f%7Cc%3A%2366788f%2Ct%3Aroad%7Ce%3Aall%7Cv%3Aon%7Cc%3A%231a1f24%2Ct%3Aroad%7Ce%3Al.t.f%7Cc%3A%2366788f%2Ct%3Asubway%7Ce%3Al.i%7Cv%3Aoff%7Cc%3A%2366788f%2Ct%3Ahighway%7Ce%3Al.i%7Cv%3Aoff","http://api1.map.bdimg.com/customimage/tile?&x=${x}&y=${y}&z=${z}&udt=20150601&styles=t%3Aland%7Ce%3Ag%7Cc%3A%23303845%2Ct%3Awater%7Ce%3Aall%7Cc%3A%23232931%2Ct%3Agreen%7Ce%3Aall%7Cc%3A%23232931%2Ct%3Aadministrative%7Ce%3Al.t.s%7Cc%3A%231e232a%2Ct%3Ahighway%7Ce%3Aall%7Cv%3Aoff%7Cc%3A%231e232a%7Cw%3A0.1%2Ct%3Alocal%7Ce%3Aall%7Cv%3Aoff%7Cc%3A%231e232a%7Cw%3A0.1%2Ct%3Asubway%7Ce%3Aall%7Cv%3Aoff%7Cw%3A0.1%2Ct%3Arailway%7Ce%3Aall%7Cv%3Aoff%7Cc%3A%231e232a%7Cw%3A0.1%2Ct%3Aroad%7Ce%3Aall%7Cv%3Aon%7Cc%3A%23ffffff%7Cw%3A0.1%2Ct%3Apoi%7Ce%3Aall%7Cv%3Aoff%2Ct%3Amanmade%7Ce%3Aall%7Cv%3Aoff%2Ct%3Aadministrative%7Ce%3Al.t.f%7Cc%3A%2366788f%7Cw%3A0.1%2Ct%3Alabel%7Ce%3Al.t.f%7Cc%3A%2366788f%2Ct%3Aroad%7Ce%3Aall%7Cv%3Aon%7Cc%3A%231a1f24%2Ct%3Aroad%7Ce%3Al.t.f%7Cc%3A%2366788f%2Ct%3Asubway%7Ce%3Al.i%7Cv%3Aoff%7Cc%3A%2366788f%2Ct%3Ahighway%7Ce%3Al.i%7Cv%3Aoff"
                         ],
                         "centerPoint": [118.70641362576298, 31.992809596859182],
                         "fullExtent": [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892],
                         "isBaseLayer": true
                     }
                 }],
                 "sattilateLayer": []
             };
            var mapContainer = document.getElementById('mapId');
            var mapConfig = new MapPlatForm.Base.MapConfig();
            var resultJson = mapConfig.createMap(mapContainer, mapConfigResult);
            var map = resultJson.map;
            var mapLineAnim = new MapPlatForm.Base.MapLineAnim(map);
            var lines = [];
            var pt = map.getCenter();
            var distance = new NPMapLib.GisToolKit().getDistanceByProjection(10000, map);
            var lines = [];
            for (var i = 0; i < trafficLines.length; i++) {
                var points = [];
                for (var j = 0;j<trafficLines[i][0].length;j++) {
                    var p = new NPMap.Geometry.Point(trafficLines[i][0][j][0],trafficLines[i][0][j][1]);
                    points.push(p);
                }
                var line = new NPMap.Geometry.Polyline(points);
                lines.push(line);
            }
            mapLineAnim.addTargetPoint(new NPMapLib.Geometry.Point(118.70641362576298, 31.992809596859182),{
                //颜色值设置为"rgba(255,0,255,0.3)"或者 "rgb(255,0,255)"格式，否则达不到效果
                // color:"rgba(255,0,0,0.9)"
            });
            mapLineAnim.addLines(lines,{
                //颜色值设置为"rgba(255,0,255,0.3)"或者 "rgb(255,0,255)"格式，否则达不到效果
                // color:"rgba(255,0,255,0.3)"
            });
    </script>
</body>

</html>
